package com.tedu.review.day02;

import java.io.Serializable;

/**
 * 重点：JavaBean   Java实体类|Java豆
 */


public class Person implements Serializable {
   private String name; //成员变量未赋值【没有初始化】
    //设置 set和get方法：设置属性|成员变量的获取以及设置方法
    public Person(String name, int age, char sex) {
        this.name = name;
        this.age = age;
        this.sex = sex;
    }

    private int age;
   private char sex;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public char getSex() {
        return sex;
    }

    public void setSex(char sex) {
        this.sex = sex;
    }
    //  属性值：传输不清楚内部数据---需要使用toString()打印属性数据
    @Override
    public String toString() {
        return "Person{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", sex=" + sex +
                '}';
    }
}
